package javase.javase01.exercise03;

import java.io.File;
import java.io.IOException;

/**
 * @author: Gan
 * @date 2021/4/15 0015 14:05
 * @description:
 **/
public class FileDemo {
    public static void main(String[] args) {
        File f1 = new File("D:\\file.exercise");
        System.out.println(f1.exists());
        System.out.println(System.getProperty("user.dir"));
        File f3 = new File("1");

        File f2 = new File("D:\\exercise.txt");
        try {
            //创建一个新文件
            System.out.println(f2.createNewFile());
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }


    }
}
